package com.yc.sole.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.sole.common.enums.CommonState;
import jakarta.persistence.*;
import lombok.Data;

/**
 * 部门对象
 *
 * @author yizuomin
 * @date 2023-03-26
 **/
@Data
@Entity
@Table(name = "sys_dept")
@TableName(value = "sys_dept")
public class Dept {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 部门名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '部门名称'")
    private String deptName;
    /**
     * 上级部门id
     */
    @Column(columnDefinition = "BIGINT NOT NULL DEFAULT 0 COMMENT '上级部门id'")
    private Long parentId;
    /**
     * 状态 0无效 1有效
     */
    @Column(columnDefinition = "TINYINT(1) NOT NULL COMMENT '状态 0无效 1有效'")
    private CommonState state;
    /**
     * 排序
     */
    @Column(columnDefinition = "INT NOT NULL COMMENT '排序'")
    private Integer sort;
}
